import * as Types from '../mutation-types'

const user = {
  state: {
    token: ''
  },
  mutations: {
    [Types.SET_TOKEN]: (state, token) => {
      state.token = token
    }
  },
  actions: {
    login({ commit }, userInfo) {
      // ...
      commit(Types.SET_TOKEN, 'sdsgdgd')
    },
    logout({ commit }) {
      // ...
    }
  }
}

export default user
